#ifndef __UI_H
#define __UI_H

#include <cstdlib>
#include "manager.h"

class Ui {
    using Func = void (Ui::*)();

public:
    void Run();

    void MainPage();
    void ServicePage();
    void ManagePage();
    void StatsPage();

    void AppendPage();
    void QueryPage();
    void DisplayPage();
    void RemovePage();
    void LoadPage();
    void SavePage();

    inline void Pause() {
        std::system("pause");
        CleanScreen();
    }
    inline void CleanScreen() { std::system("cls"); }

private:
    Manager manager;

    constexpr static const Func main_page_switch[] = {&ServicePage, &ManagePage,
                                                      &StatsPage};

    constexpr static const Func manage_page_switch[] = {
        &AppendPage, &QueryPage, &DisplayPage,
        &RemovePage, &LoadPage,  &SavePage};

    constexpr static const char* data_file[] = {"data/customers.txt",
                                                "data/staffs.txt"};

private:
    void LoadUI(const char* path);
};

#endif